# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=volume_key
pkgver=0.3.11
pkgrel=2
pkgdesc="A library for manipulating storage volume encryption keys and storing them separately from volumes to handle forgotten passphrases"
arch=('x86_64')
url="https://pagure.io/volume_key"
license=('GPL')
depends=('cryptsetup' 'nss' 'gpgme')
makedepends=('python' 'swig')
optdepends=('python: for python bindings')
source=("https://github.com/felixonmars/volume_key/archive/volume_key-$pkgver.tar.gz")
sha512sums=('594995cda12562a6beb6a404e2d6a152fcca6c08c1c6eae4d3c7ded8b4a55d43ddef1e45956075c7168c5f4919e38c87f79caf1af4e9cbc371eabc5228259f07')

prepare() {
  cd "$srcdir"/volume_key-volume_key-$pkgver
  
  autoreconf -i

  find . -name ".pyc" -delete
}

build() {
  cd "$srcdir"/volume_key-volume_key-$pkgver
  ./configure --prefix=/usr
  make
}

package() {
  cd "$srcdir"/volume_key-volume_key-$pkgver
  make DESTDIR="$pkgdir" install
  sed -i '/#include <config.h>/d' "$pkgdir"/usr/include/volume_key/libvolume_key.h
}
